package com.cx.service.Impl;

import com.cx.dao.userDao;
import com.cx.domain.user;
import com.cx.service.userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class userserviceImpl implements userservice {

    @Autowired
    private userDao userDao;

    public List<user> save() {
        return userDao.selectall();
    }

    @Override
    public boolean insertuser(String name, String password) {
        try {
            userDao.insertuser(name,password);
            return true;
        } catch (Exception e) {
            return false;
        }
    }

    @Override
    public String selectname(String name) {
        return userDao.selectname(name);
    }

    @Override
    public void deleteuser(String name, String passord) {
        userDao.deleteUser(name,passord);
    }


}
